package org.example;

import javax.swing.*;
import java.awt.*;

public class GoBangUI {
    GoListener gl = new GoListener();
    public void showUI(){
        GoFrame gf = new GoFrame();
        gf.setTitle("五子棋");
        gf.setSize(1000,900);
        gf.setLocation(200,100);
        gf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel jp = new JPanel();
        jp.setLayout(null);
        String[] btnString={"开始","悔棋","重新开始","保存","继续","复盘"};
        for(int i=0;i<btnString.length;i++){
            JButton btn = new JButton(btnString[i]);
            btn.setBackground(Color.WHITE);
            btn.setFont(new Font("宋体",Font.BOLD,20));
            btn.setBounds(850,50+40*i,120,35);
            jp.add(btn);
            btn.addActionListener(gl);
        }
        gf.add(jp);
        gf.setVisible(true);
        gf.addMouseListener(gl);
        gl.g=gf.getGraphics();
    }
    public static void main(String[] args) {
        GoBangUI goBangUI = new GoBangUI();
        goBangUI.showUI();
    }
}
